package com.rybbaby.tss.front.tssSemester.entity;

import com.rybbaby.tss.platform.sysAdminUser.entity.SysAdminUser;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @description 学期表
 * 
 * @author 雷春琼
 * 
 * @createDate 2017-08-09 下午11:50:14
 */
@Entity
@Table(name = "tss_semester")
@DynamicUpdate(true)
@DynamicInsert(true)
public class TssSemester implements Serializable {


	private static final long serialVersionUID = -7995914032321932087L;

	/** 主键 **/
	private String id;
	/** 课程类型 **/
	private Integer type;
	/** 年份 **/
	private Integer particularYear;
	/** 起始时间 **/
	private Date startDate;
	/** 截止时间 **/
	private Date endDate;
	/** 创建时间 **/
	private java.sql.Timestamp createTime;
	/** 修改时间 **/
	private java.sql.Timestamp updateTime;
	/** 版本 **/
	private Integer version;

	private String adminUserId;

	private SysAdminUser sysAdminUser;

	/**
	 * 方法: 取得主键
	 *
	 * @return java.lang.String 主键
	 */
	@Id
	@GeneratedValue(generator = "tss_classesIDGenerator" , strategy = GenerationType.AUTO)
	@GenericGenerator(name = "tss_classesIDGenerator" , strategy = "uuid")
	@Column(name = "id", nullable= false, length = 32)
	public String getId() {
		return this.id;
	}

	/**
	 * 方法: 设置主键
	 *
	 * @param id 主键
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * 方法: 学期类型
	 *
	 * @return java.lang.Integer 学期类型
	 */
	@Column(name = "type", nullable= true, length = 11)
	public Integer getType() {
		return this.type;
	}

	/**
	 * 方法: 学期类型
	 *
	 * @param type 学期类型
	 */
	public void setType(Integer type) {
		this.type = type;
	}






	/**
	 * 方法: 取得起始时间
	 *
	 * @return java.sql.Timestamp 起始时间
	 */
	@Column(name = "startDate", nullable= true, length = 10)
	public Date getStartDate() {
		return this.startDate;
	}

	/**
	 * 方法: 设置起始时间
	 *
	 * @param startDate 起始时间
	 */
	public void setStartDate(java.util.Date startDate) {
		this.startDate = startDate;
	}

	/**
	 * 方法: 取得截止时间
	 *
	 * @return java.sql.Timestamp 截止时间
	 */
	@Column(name = "endDate", nullable= true, length = 10)
	public Date getEndDate() {
		return this.endDate;
	}

	/**
	 * 方法: 设置截止时间
	 *
	 * @param endDate 截止时间
	 */
	public void setEndDate(java.util.Date endDate) {
		this.endDate = endDate;
	}





	/**
	 * 方法: 取得创建时间
	 *
	 * @return java.sql.Timestamp 创建时间
	 */
	@Column(name = "createTime", nullable= true, length = 19)
	public java.sql.Timestamp getCreateTime() {
		return this.createTime;
	}

	/**
	 * 方法: 设置创建时间
	 *
	 * @param createTime 创建时间
	 */
	public void setCreateTime(java.sql.Timestamp createTime) {
		this.createTime = createTime;
	}

	/**
	 * 方法: 取得修改时间
	 *
	 * @return java.sql.Timestamp 修改时间
	 */
	@Column(name = "updateTime", nullable= true, length = 19)
	public java.sql.Timestamp getUpdateTime() {
		return this.updateTime;
	}

	/**
	 * 方法: 设置修改时间
	 *
	 * @param updateTime 修改时间
	 */
	public void setUpdateTime(java.sql.Timestamp updateTime) {
		this.updateTime = updateTime;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	/**
	 * 方法: 版本
	 *
	 * @return java.lang.Integer 版本
	 */
	@Version
	@Column(name = "version", nullable= true, length = 11)
	public Integer getVersion() {
		return this.version;
	}

	@Column(name = "particularYear", nullable= true, length = 11)
	public Integer getParticularYear() {
		return particularYear;
	}

	public void setParticularYear(Integer particularYear) {
		this.particularYear = particularYear;
	}

	@Column(name = "adminUserId", nullable= true, length = 32)
	public String getAdminUserId() {
		return adminUserId;
	}

	public void setAdminUserId(String adminUserId) {
		this.adminUserId = adminUserId;
	}

	/**
	 * 获取用户信息
	 * @return
	 */
	@JoinColumn(name = "adminUserId" , insertable = false , updatable = false)
	@ManyToOne(fetch = FetchType.LAZY , targetEntity = SysAdminUser.class)
	public SysAdminUser getSysAdminUser() {
		return sysAdminUser;
	}

	public void setSysAdminUser(SysAdminUser sysAdminUser) {
		this.sysAdminUser = sysAdminUser;
	}
}